package com.java01.apache.commons.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

import org.apache.commons.io.HexDump;
import org.apache.commons.io.IOUtils;

public class HexDumpByteArray {

	public static void main(String[] args) {
		File src = new File("D:/src.txt");
		File dest = new File("D:/dest.txt");

		byte[] srcByteArray = null;
		try {
			srcByteArray = IOUtils.toByteArray(new FileInputStream(src));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
		
		try {
			HexDump.dump(srcByteArray, 0, new FileOutputStream(dest), 0);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
